﻿IF OBJECT_ID('up_Vendor_Visit_Distributions_TransformerImages_SelectById') IS not NULL
DROP PROC up_Vendor_Visit_Distributions_TransformerImages_SelectById

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_Vendor_Visit_Distributions_TransformerImages_SelectById')
	DROP PROCEDURE up_Vendor_Visit_Distributions_TransformerImages_SelectById
GO


CREATE PROCEDURE [dbo].[up_Vendor_Visit_Distributions_TransformerImages_SelectById] 
(
	@imageID int
)
AS

SELECT 
	Vendor_Distribution_Transformer_ImageId as 'ID',
	Vendor_Distribution_TransformerFk as 'PoleID',
	[filename] as 'FileName'
FROM 
	tb_Vendor_Distribution_TransformerImages
WHERE
	Vendor_Distribution_Transformer_ImageId = @imageID
